package com.example.fqapp.ui

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.example.fqapp.application.MyApplication
import com.example.fqapp.databinding.ActivityMainBinding
import timber.log.Timber

class MainActivity : AppCompatActivity() {
    private lateinit var binding: ActivityMainBinding
    private var myApplication:MyApplication = MyApplication.instance

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)

        Timber.d("enter")
        binding.btPublish.setOnClickListener(View.OnClickListener {
            Timber.d("btPublish click")
            Timber.d("myApp.tempString=%s", myApplication.tempString)
            myApplication.mqttManager.publish("testtopic/receive", "123456789", false, 1)
        })
    }
}